package com.epam.web_project.bank.command.show_commands;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.epam.web_project.bank.command.Command;
import com.epam.web_project.bank.entity.Customer;
import com.epam.web_project.bank.util.AppPropertiesLoader;

public class ShowCardRequestCommand implements Command {

	//show page for card requests
	@Override
	public String execute(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		AppPropertiesLoader propLoader=AppPropertiesLoader.getInstance();
		HttpSession session = request.getSession();
		Customer customer=(Customer)session.getAttribute("customer");
		if(customer==null) {
			return propLoader.getProperty("login_page");
		} else {
			return propLoader.getProperty("card_request_page");
		}
	}

}	
